#ifndef classGOST28147H
 #define classGOST28147H


 #include "CPU_const.h"
 
 

/****************************************************************************************************/
/*                              L O W L E V E L     D E F I N E                                     */
/*                               ( d o n ' t     c h a n g e )                                      */
/****************************************************************************************************/
  #define MOD32_1       0xFFFFFFFF
  #define C1gen         0x01010101
  #define C2gen         0x01010104
  #define BiMAX       ( MOD32_1-C2gen )








class GOST28147
{
//  bool grab, fatal_err;
  uint AloGen, BhiGen;

private:  
  void ForwardCycle(uint *pN1, uint *pN2);
  void BackCycle(uint *pN1, uint *pN2);
  void MainStep(uint *pN1, uint *pN2, uint X);
  uint TablChanging(uint valIn);
  void swap(uint *pA, uint *pB);

public:
//
  GOST28147(void) {};
//  
  void INITgen(uint *pBhi, uint *pAlo);
  //void TACTgen(void);
  void TACTgen(uint *pBhi, uint *pAlo);
  void XORgen(uint *pDataHi, uint *pDataLo);
//
  void EncryptionCycle(uint *pBhi, uint *pAlo);
  void DecryptionCycle(uint *pBhi, uint *pAlo);
  void AuthenticationCycle(uint *pN1, uint *pN2);
//
  
//
};


#endif